Open
Conversation
- Added total_tokens, input_tokens, output_tokens, reasoning_tokens, and cached_tokens fields to RequestLog and RequestLogger classes. - Updated RequestStats to track and aggregate token usage metrics for hourly and daily statistics. - Modified database schema to include new token usage columns in request_logs table. - Implemented token usage estimation utilities for both chat and image prompts. - Enhanced OpenAI routes to log detailed token usage information during request processing. - Updated TypeScript utilities to support token estimation and usage tracking for image generation and editing. feat: 增强请求日志和统计中的 token 使用量跟踪 - 在 RequestLog 和 RequestLogger 类中添加了 total_tokens、input_tokens、output_tokens、reasoning_tokens 和 cached_tokens 字段。 - 更新 RequestStats 以跟踪和汇总每小时及每日 token 使用量指标。 - 修改数据库 schema,在 request_logs 表中新增 token 使用量相关列。 - 实现了适用于聊天和图像提示的 token 使用量估算工具。 - 增强 OpenAI 路由,在请求处理过程中记录详细的 token 使用信息。 - 更新 TypeScript 工具,支持图像生成和编辑的 token 估算与使用量跟踪。
feat(数据中心):在 UI 中添加令牌指标显示
…ging feat(chat):增强流式处理和日志中的 token 使用量跟踪
feat(logs): 更新请求日志结构以包含 token 指标
…Log function fix(logs): 修正 addRequestLog 函数中 SQL 插入语句的参数数量处理错误
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
编辑一半点错了,这标题怎么改不了😂
feat: 增强请求日志和统计中的 token 使用量跟踪